<template>
    <div class="cultural">
        <!-- 非遗动态 -->
        <div v-for="(i,index) in typeList" :key="index">
            <!-- 动态 -->
            <Trends v-if="i.order == '1'" :id="i.id" :title="i.name" />
        </div>
        <div v-for="(i,index) in typeList" :key="index">
            <!-- 传承人 -->
            <Inherit v-if="i.order == '4'" :id="i.id" :title="i.name" />
        </div>
        <div v-for="(i,index) in typeList" :key="index">
            <!-- 项目 -->
            <Project v-if="i.order == '3'" :id="i.id" :title="i.name" />
        </div>
        <div v-for="(i,index) in typeList" :key="index">
            <!-- 法规 -->
            <Law v-if="i.order == '5'" :id="i.id" :title="i.name" />
        </div>
        <div v-for="(i,index) in typeList" :key="index">
            <!-- 项目 -->
            <Project v-if="i.order == '2'" :id="i.id" :title="i.name" />
        </div>
    </div>
</template>

<script>
    import Trends from "@/views/intangibleCultural/cp/Trends";
    import Inherit from "@/views/intangibleCultural/cp/Inherit";
    import Project from "@/views/intangibleCultural/cp/Project";
    import Law from "@/views/intangibleCultural/cp/Law";
    import {
        heritageCategory
    } from "@/utils/heritage/index.js";
    export default {
        components: {
            Trends,
            Inherit,
            Project,
            Law
        },
        data() {
            return {
                typeList: []
            };
        },

        created() {
            this.getTypeList();
        },

        methods: {
            // 获取活动分类
            getTypeList() {
                let that = this
                heritageCategory().then((response) => {
                    that.typeList = response.data
                });
            },
        },
    };
</script>

<style lang="scss" scoped>
    .cultural {
        width: 100%;
    }
</style>